package patrol.mobile.com.mobilepatrol.activity;

import android.view.View;

import java.util.List;

import butterknife.BindView;
import patrol.mobile.com.mobilepatrol.R;
import patrol.mobile.com.mobilepatrol.adapter.PhotoSetAdapter;
import patrol.mobile.com.mobilepatrol.utils.CommonUtil;
import patrol.mobile.com.mobilepatrol.widget.PhotoViewPager;

/**
 * Created by apple on 17/10/13.
 */

public class PhotoSetActivity extends BaseActivity{
    @BindView(R.id.vp_photo)
    PhotoViewPager mVpPhoto;

    private PhotoSetAdapter mAdapter;
    @Override
    protected int attachLayoutRes() {
        return R.layout.activity_photo_set;
    }

    @Override
    public void setListener() {

    }

    @Override
    public void initData() {
        super.initData();
        List<String> imgUrls = (List<String>) getIntent().getSerializableExtra("imgs");

        mAdapter = new PhotoSetAdapter(this, imgUrls);
        mVpPhoto.setAdapter(mAdapter);
        mVpPhoto.setOffscreenPageLimit(imgUrls.size());
    }

    @Override
    public void initTitle() {
        iv_back.setImageResource(R.mipmap.up_white);
        iv_back.setVisibility(View.VISIBLE);
        iv_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                CommonUtil.exitActivityAndBackAnim(PhotoSetActivity.this, true);
            }
        });
        tv_center_title.setVisibility(View.VISIBLE);
        tv_center_title.setText("图片查看");
    }
}
